import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App';

// 5. 导入全局状态 store
import store from './store/index'


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>
);


// 6. 订阅状态管理器，全局数据有发生变化会直接重新渲染
store.subscribe(() => {
  root.render(<App />)
})